package net.helix.ui.interactive.mouse;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

public class MouseHelper implements MouseListener, MouseMotionListener{

	public boolean mouseDown = false;
	public boolean middleMouseDown = false;
	public boolean rightMouseDown = false;
	
	
	public boolean mouseOver = false;
	
	@Override
	public void mouseDragged(MouseEvent arg0) {
		
	}

	@Override
	public void mouseMoved(MouseEvent arg0) {
		
	}

	@Override
	public void mouseClicked(MouseEvent arg0) {
		// perhaps detect a double click here?
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		mouseOver = true;
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		mouseOver = false;
	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		if(arg0.getButton() == MouseEvent.BUTTON1){
			mouseDown = true;
		}
		if(arg0.getButton() == MouseEvent.BUTTON2){
			middleMouseDown = true;
		}
		if(arg0.getButton() == MouseEvent.BUTTON3){
			rightMouseDown = true;
		}
		
		
		mouseOver = true; // because it has to be over for this to happen...
		
	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		if(arg0.getButton() == MouseEvent.BUTTON1){
			mouseDown = false;
		}
		if(arg0.getButton() == MouseEvent.BUTTON2){
			middleMouseDown = false;
		}
		if(arg0.getButton() == MouseEvent.BUTTON3){
			rightMouseDown = false;
		}
	}

}
